get Days Of Week
Translates a numeric bitmask value into an EnumSet of selected DayOfWeekType
enums.
Each bit in the input value
corresponds to a day of the week. If a bit is set, the corresponding DayOfWeekType
will be included in the returned set.
Example:
EnumSet<DayOfWeekType> weekend = DayOfWeekType.getDaysOfWeek(
DayOfWeekType.SATURDAY.getValue() | DayOfWeekType.SUNDAY.getValue()
);
// weekend will contain SATURDAY and SUNDAY
EnumSet<DayOfWeekType> workWeek = DayOfWeekType.getDaysOfWeek(0b0111110); // Monday to Friday
// workWeek will contain MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY
Content copied to clipboard
Return
A non-null EnumSet containing the DayOfWeekType
enums that correspond to the set bits in the input value
. If value
is 0 or contains no bits matching any day, an empty set is returned.
Parameters
value
The bitmask value representing a combination of days of the week.